package com.ms.game.sendgift;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ms.game.lobby.GameLobbyModule;
import com.ms.game.sendgift.message.SendGiftRequest;
import com.ms.service.module.analysisgroup.AnalysisGroupProcessor;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.annotations.MessageType;
import com.xpec.c4.service.common.BaseMessageAction;
import com.xpec.c4.service.contexts.Contexts;

public class SendGiftAction extends BaseMessageAction {
	
	@SuppressWarnings("unused")
	private static final Log log = LogFactory.getLog(SendGiftAction.class);
	
	@MessageType(typeCode = MessageTypes.C_GIFT_FIRST_SEND_REQUEST)
	public void sendGiftFirstStep(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftFirstStep(sessionID, request, module);
		AnalysisGroupProcessor.sendGiftSendingTimeCheckToAnalysis(sessionID);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_FIRST_CANCEL_REQUEST)
	public void sendGiftCancelFirstStep(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftCancelFirstStep(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_SECOND_ACCEPT_REQUEST)
	public void sendGiftSecondAccept(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftSecondAccept(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_FINIAL_GIVE_REQUEST)
	public void sendGiftFinialAccept(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftFinialAccept(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_GET_REJECTED_ORDER_REQUEST)
	public void sendGiftGetRejectedOrder(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftGetRejectedOrder(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_FINAL_TAKEN_REQUEST)
	public void sendGiftFinalTaken(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftFinalTaken(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_GET_TIMEOUT_ORDER_REQUEST)
	public void sendGiftGetTimeoutOrder(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftGetTimeoutOrder(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_GET_GMTOOL_RETURN_ORDER_REQUEST)
	public void sendGiftGetGMToolReturnOrder(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftGetGMReturnOrder(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_GET_ALL_NOTIFY_REQUEST)
	public void sendGiftGetAllNotify(Object request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftGetAllNotify(sessionID, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_GET_RECORD_REQUEST)
	public void sendGiftGetRecord(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftGetRecord(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_GET_RECORD_DETAIL_REQUEST)
	public void sendGiftGetRecordDetail(SendGiftRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnSendGiftGetRecordDetail(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_GIFT_CHECK_TIME_OUT_REQUEST)
	public void updateMoneyNotify(Object request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		SendGiftProcessor.OnUpdateMoneyNotify(sessionID, module);
	}
}
